IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GetClinicalTrialBudgetMilestoneVisitsInformation]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[GetClinicalTrialBudgetMilestoneVisitsInformation]

GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO


CREATE PROCEDURE [dbo].[GetClinicalTrialBudgetMilestoneVisitsInformation] (
   @ClinicalTrialBudgetVisitId int,
   @relateId int 
)
AS
BEGIN
   SET NOCOUNT ON
     -- Insert a new entry into the milestone visit table that is a copy of the old milestone visit 
      BEGIN
		SELECT * FROM ClinicalTrialBudgetMilestoneVisit where ClinicalTrialBudgetVisitId = @ClinicalTrialBudgetVisitId and RelateId = @RelateId 
		IF @@ERROR <> 0 
         BEGIN
            RAISERROR ('Failed to clone clinical trial budget milestone visit. Error = %s.', 16, 1, @@ERROR)
            RETURN
         END
      END
END

